package day05;

import java.util.Arrays;
import java.util.Random;

public class ArraySort {
    public static Object qe(String num){

        return num;
    }
    public static void main(String[] args) {




        int[] arr = new int[8];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * 1000 + 1);
            System.out.println(arr[i]);
        }

        Arrays.sort(arr);
        System.out.println("正着排序");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("倒着排序");
        for (int i = arr.length - 1; i >= 0; i--) {
            System.out.println(arr[i]);
        }

        Random rand = new Random();
        int [] arrd = new int[10];
        for (int i = 0;i<arr.length;i++){
            arrd[i] = rand.nextInt(100);
            System.out.println(arrd[i]);
        }















    }
}
